# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=gifski
pkgver=1.32.0
pkgrel=0
pkgdesc="Highest-quality GIF encoder based on pngquant"
url="https://gif.ski/"
license="AGPL-3.0-or-later"
arch="all"
makedepends="cargo clang16-dev ffmpeg-dev cargo-auditable"
source="https://github.com/ImageOptim/gifski/archive/$pkgver/gifski-$pkgver.tar.gz
	update-rust-libc.patch
	"
options="net" # fetch dependencies

_features="--features=video"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release $_features
}

check() {
	cargo test --frozen $_features
}

package() {
	install -Dm755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
0088917b5080c31efe98c76193b119069c1eb8ac9d50e98b207371ed2e22a3a4203f6f2cfee4b885d99d7d85d1f0d247831002997aac4058e8eb70b647f82988  gifski-1.32.0.tar.gz
3201db33b4579177a1e64bf0fb293d8d83022ca3723fc772621c03467756b5ce6d60ffd36d3d14d01e645159739f504347658a2ac44ad97fb56d783c29fd3697  update-rust-libc.patch
"
